
<%@page import="java.util.Iterator"%>
<%@page import="Shop.TypeProduct"%>
<%@page import="java.util.ArrayList"%>
<%@ page import="WebContainer.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="public_source/css_source/left_contend.css" rel="stylesheet" type="text/css"/>
        <script src="public_source/javascript/jquery-1.9.1.js" type="text/javascript"></script>
        <script src="public_source/javascript/jquery-ui.js" type="text/javascript"></script>
        <link href="public_source/javascript/jquery-ui.css" rel="stylesheet" type="text/css"/>


<script type="text/javascript">

$(document).ready(function() {

    $(function() {
        $( "#txt_searchproduct" ).autocomplete({
                                           
            source: function(request, response) {

                $.ajax({ url: "<?php echo site_url('home/suggestions'); ?>",

                data: { term: $("#txt_searchproduct").val() , select: $("#se").val()},

                dataType: "json",

                type: "POST",

                success: function(data){
                    response(data);

                }

            });

        },
delay: 100,

        minLength: 1

        });

    });

});

</script>
    </head>
    <body>
        <div ID="LeftContend">
            <div ID="KindOfProduct">
                <div ID="KindOfProduct_Image">
                    <img src="public_source/images_source/boxtitle.png">
                    <div ID="KindOfProduct_Title">
                        List Product
                    </div>
                </div>
                <div ID="KindOfProduct_Border">
                    <div id="wrapper">
                        <ul id='nav'>
                            <% ArrayList<TypeProduct> a = (ArrayList<TypeProduct>)request.getAttribute("lstType"); 
                               for(TypeProduct b : a) {%>
                            <li><a href=""><%=b.getNameType()%></a></li>
                                        <%
                                }
                                %>
                        </ul> 
                    </div>
                </div>
            </div>
            
            <div ID="Search">
                <div ID="Search_Image">
                    <img src="public_source/images_source/boxtitle.png">
                    <div ID="Search_Title">
                        Search
                    </div>
                </div>
                <div ID="Search_Border">
                    <form id="FormSearch" method="POST" action="home/findProduct1">
                        Keyword:<br>
                        <input type="text" id="txt_searchproduct" name="txt_searchproduct" placeholder="Name Product">
                        List Type:<br>
                        <select id="se" name="se">
                           <% for(TypeProduct b : a) {%>
                            <option value="<% b.getIdType();%>"><%= b.getNameType() %></option>
                                        <%
                                }
                            %>
                        </select>
                        <br>
                        <input type="submit" value="Search" id="SearchButton">
                    </form>
                </div>
            </div>
            
            <div ID="CountVisitor">
                <div ID="CountVisitor_Image">
                    <img src="public_source/images_source/boxtitle.png">
                    <div ID="CountVisitor_Title">
                        Visits
                    </div>
                </div>
                <div ID="CountVisitor_Border">
                    <div ID="CountVisitor_Style">
                        <%                       
//                        $ec_username = 'tendote04';
//
//                        if (!$ec_fsock = fsockopen('www.easycounter.com', 80, $errno, $errstr, 2)) {
//                          echo '<img src="http://www.easycounter.com/images/error.png">';
//                        } else {
//                          fputs($ec_fsock, "GET /php.counter.php?username=".urlencode($ec_username)." HTTP/1.0\r\n".
//                          "Host:www.easycounter.com\r\n\r\n");
//                          $ec_buffer = '';
//                          while (!feof($ec_fsock)) $ec_buffer .= fgets($ec_fsock, 1024);
//                          echo substr($ec_buffer, strpos($ec_buffer, "\n\r\n")+3);
//                          fclose($ec_fsock);
//                        }                       
                        %>
                    </div>
                    <div ID="CountVisitor_Popular">
                        <a href="http://whos.amung.us/stats/n5maerjk7gtw/">
                        <img title="Click to see how many people are online" src="http://whos.amung.us/widget/n5maerjk7gtw.png" border="0" alt="" width="81" height="29">
                        </a>
                    </div>
                </div>
            </div>            
        </div>                
    </body>
</html>